<?php

/*

Creating Gallery (makegallery.pro.php)

*/
ob_start();
include "global.inc.php";

$find_gallery = fetch("SELECT id FROM usergallerys WHERE owner = '$userid' AND game = '$game'");
if ($find_gallery[id])
{
	die(header(error("mygallery.php?game=$game","You already have a gallery, see:")));
}

if ($points < 250)
{
	die(header(error("makegallery.php?game=$game","You cannot afford the 250 $pointsVar to create a gallery.")));
}

points($game,"$username", "-250");

$gallery_name = smilies(badwords(strip_tags($gallery_name,"<b><i>")));
$gallery_desc = smilies(badwords(strip_tags($gallery_desc,"<b><i><u><a><font><p><br><center><img>")));

mysql_query("INSERT INTO usergallerys (owner,gallery_name,gallery_desc,game) VALUES ('$userid','$gallery_name','$gallery_desc','$game')");

die(header(error("mygallery.php?game=$game","Your gallery has been created!")));

?>